import scrapy
from allstocksname import g_StockNameDict

class DmozSpider(scrapy.Spider):
    name = "dashi"
    allowed_domains = ["10jqka.com.cn"]
    start_urls = []
    
    def __init__(self):
        for key in g_StockNameDict.keys():
            DmozSpider.start_urls.append('http://basic.10jqka.com.cn/mobile/%s/reminddetailn.html'%(key[2:8]))
            
    def parse(self, response):
        filename = response.url.split("/")[-2]
        filepath = "E:/temp/dashi/" + filename + ".html"
        
        with open(filepath, 'wb') as f:
            f.write(response.body)
        